#include <string.h>

struct convert_table {
	const char *modtype;
	const char *serialname;
};

const convert_table tables[] = {
	{ "Q2Pro", "/dev/ttyAMA1" },
	{ "A2Pro", "/dev/ttyAMA1" },
	{ "A2-300", "/dev/ttyAMA4" },
	{ "Q1", "/dev/ttyS0" },
	{ "Q5", "/dev/ttyS0" },
};

const char *findname(const char *typenames)
{
	for (auto &p : tables) {
		if (!strcmp(typenames, p.modtype)) {
			return p.serialname;
		}
	}
	return "null";
}

extern "C" const char *get_mcu_port_name(void)
{
	/* const char *ret = findname(MODTYPE); */
	const char *ret = findname("Q5");
	return ret;
}
